<?php

/**
 * @author Jeevan Tomson
 * @copyright 2011
 */

    function __autoload($classname) {
        if(file_exists(APP_DIRECTORY."/classes/".$classname.".php"))
            include_once(APP_DIRECTORY."/classes/".$classname.".php");
    }
    
    $lifetime=600;
    session_start(); // Start Session
    setcookie(session_name(),session_id(),time()+$lifetime);

    header('Cache-control: private'); // IE 6 FIX
    // always modified
    header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
    // HTTP/1.1
    header('Cache-Control: no-store, no-cache, must-revalidate');
    header('Cache-Control: post-check=0, pre-check=0', false);
    // HTTP/1.0
    header('Pragma: no-cache');

    require_once(APP_DIRECTORY."/config/conf.php");
    require_once(APP_DIRECTORY."/lib/functions.php");
    
    require_once(APP_DIRECTORY."/adodb5/adodb.inc.php");
    require_once(APP_DIRECTORY."/adodb5/adodb-exceptions.inc.php");
    
    $ADODB_CACHE_DIR = APP_DIRECTORY."/adodb5/ADODB_cache";
    
    $db = &ADONewConnection(DB_TYPE);
    $db->SetFetchMode(ADODB_FETCH_ASSOC);
    $db->cacheSecs = 3600*24; 
    //$db->debug = true; 
    $db->Connect(SERVER_NAME, DB_USER_NAME, DB_PASSWORD, DB_NAME);
    

    require_once(APP_DIRECTORY."/log4php/Logger.php");
    require_once(APP_DIRECTORY."/log4php/LoggerLevel.php");
    Logger::configure(APP_DIRECTORY."/log4php.properties");
    
    spl_autoload_register('__autoload');
    
    $langMgr = new LanguageManager();
    $user_lang = getLanguage();
    
    $labelMgr = new LabelManager($user_lang);
    
    


?>